﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


public class BasePage : Microsoft.Practices.CompositeWeb.Web.UI.Page
{

    public static int CID;
    
    public void ShowMessage(int MessageType, string MessageName)
    {
        switch (MessageType)
        {
            case (1):
                {
                    string msg = MessageName + " " + "Successfully";
                    StringBuilder js = new StringBuilder();
                    js.Append("showMsg('").Append(msg).Append("');");
                    this.ClientScript.RegisterStartupScript(this.GetType(), "es", js.ToString(), true);
                    break;
                }

            case (2):
                {
                    string msg = " Are you sure to proceed any further? ";
                    StringBuilder js = new StringBuilder();
                    js.Append("$(document).ready(function () {showWarning('").Append(msg).Append("')});");
                    this.ClientScript.RegisterStartupScript(this.GetType(), "", js.ToString(), true);
                    break;
                }
            case (3):
                {
                    string msg = "You may encounter some crucial problems, please contact administrator!";
                    StringBuilder js = new StringBuilder();
                    js.Append("$(document).ready(function () {showError('").Append(msg).Append("')});");
                    this.ClientScript.RegisterStartupScript(this.GetType(), "es", js.ToString(), true);
                    break;
                }


        }
    }
    /// <summary>
    /// transfer ID to certain update page
    /// </summary>
    /// <param name="courseId"></param>
    public void TransferCourseID(int courseId)
    {
        CID = courseId;
    }

}

